#ifndef AST_EXPRESSION_RELATIONAL_EXPR_H
#define AST_EXPRESSION_RELATIONAL_EXPR_H

#include "../ASTNode.h"

class ShiftExpr;
/*
C99 6.5.8
relational-expression:
		shift-expression
		relational-expression    <    shift-expression
		relational-expression    >    shift-expression
		relational-expression    <=    shift-expression
		relational-expression    >=    shift-expression
*/
class RelationalExpr : public ASTNode
{
public:
	enum{
		single_expr,
		small_expr,
		small_equal_expr,
		large_expr,
		large_equal_expr
	};
protected:
	RelationalExpr(void)
		: ASTNode(ASTNode::relational_expression){};
public:
	RelationalExpr(ShiftExpr *pSingleExpr)
		: ASTNode(ASTNode::relational_expression)
		, m_pSingleExpr(pSingleExpr)
		, m_iType(single_expr) {};
	RelationalExpr(RelationalExpr *pRlaExpr, int iType, ShiftExpr *pShiftExpr)
		: ASTNode(ASTNode::relational_expression)
		, m_pRlaExpr(pRlaExpr)
		, m_iType(iType)
		, m_pShiftExpr(pShiftExpr){};


	virtual ~RelationalExpr(void);

	virtual void					codeGen();

protected:
	tiny_int				m_iType;
	union
	{
		ShiftExpr *				m_pSingleExpr;
		struct{
			RelationalExpr *	m_pRlaExpr;
			ShiftExpr *			m_pShiftExpr;
		};
	};
};


#endif


